<template>
  <el-form ref="basicInfoForm" :model="info" :rules="rules" label-width="auto">
    <el-row>
      <el-col :span="12">
        <el-form-item :label="$t('code.tableName')" prop="tableName">
          <el-input placeholder="" v-model="info.tableName" />
        </el-form-item>
      </el-col>
      <el-col :span="12">
        <el-form-item :label="$t('code.tableDescription')" prop="tableComment">
          <el-input placeholder="" v-model="info.tableComment" />
        </el-form-item>
      </el-col>
      <el-col :span="12">
        <el-form-item :label="$t('code.entity')" prop="className">
          <el-input placeholder="" v-model="info.className" />
        </el-form-item>
      </el-col>
      <el-col :span="12">
        <el-form-item :label="$t('code.author')" prop="functionAuthor">
          <el-input placeholder="" v-model="info.functionAuthor" />
        </el-form-item>
      </el-col>
      <el-col :span="24">
        <el-form-item :label="$t('inputLabel.remark')" prop="remark">
          <el-input type="textarea" :rows="3" v-model="info.remark"></el-input>
        </el-form-item>
      </el-col>
    </el-row>
  </el-form>
</template>

<script setup>
defineProps({
  info: {
    type: Object,
    default: null
  }
});
const { proxy } = getCurrentInstance();

// 表单校验
const rules = ref({
  tableName: [{ required: true, message: proxy.i18n.code.tableNameNotNull, trigger: "blur" }],
  tableComment: [{ required: true, message: proxy.i18n.code.tableDescriptionNotNull, trigger: "blur" }],
  className: [{ required: true, message:proxy.i18n.code.entityNotNull, trigger: "blur" }],
  functionAuthor: [{ required: true, message: proxy.i18n.code.authorNotNull, trigger: "blur" }]
});
</script>
